#pragma once

template <class Polyhedron, class Kernel>
class CSpacePartitioner
{
public:
	typedef	typename Kernel::FT			FT;

	CSpacePartitioner(void) : m_pMesh(NULL) {}
	CSpacePartitioner(Polyhedron *pMesh) : m_pMesh(pMesh) {}
	virtual ~CSpacePartitioner(void) {};

	virtual void PartitionMesh(void)=0;
	virtual void DrawSpatialPartition(void)=0;
	virtual bool StoreProfile(const CString &sFileName)=0;
	virtual bool LoadProfile(const CString &sFileName)=0;

	bool isInsideModel(FT *cp)
	{
		FT x_axis[3] = {1.0, 0.0, 0.0};
		int times = m_pMesh->intersect_with_ray(cp, x_axis);
		return (times%2==0) ? FALSE : TRUE;
	}

	Polyhedron *m_pMesh;
};
